﻿using AiQiuQuan.Sport.Model.Enums;
using System.ComponentModel.DataAnnotations;

namespace AiQiuQuan.Sport.Model.Models
{
    /// <summary>
    /// 审核提现请求
    /// </summary>
    public class VenueAuditWithdrawRequestDto : IValidatableObject
    {
        /// <summary>
        /// 提现单ID
        /// </summary>
        [Required]
        public Guid WithdrawId { get; set; }

        /// <summary>
        /// 审核状态
        /// </summary>
        [Required]
        public WithdrawStateEnum State { get; set; }

        /// <summary>
        /// 管理平台用户ID
        /// </summary>
        [Required]
        public Guid PlatformUserId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// validate
        /// </summary>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (State != WithdrawStateEnum.Approved && State != WithdrawStateEnum.Rejected)
            {
                yield return new ValidationResult("审核状态不正确");
                yield break;
            }
        }
    }
}
